#ifndef FLASHTHREAD_H
#define FLASHTHREAD_H

#include <QThread>
#include "glparse.h"

class FlashThread : public QThread
{
    Q_OBJECT
private:
    enum REPLY{
        REPLY_WAIT,
        REPLY_OK,
        REPLY_FAIL
    };

    REPLY reply_status;

    GLParse *glParse;
    QString binPath;

    REPLY waitReply(int wait_delay);
    unsigned char version[3];
    int errorCode;
public:
    FlashThread();
    void run();
    void init(GLParse *glParse);
    void setBinPath(QString binPath);
signals:
    void flashStatusSignals(int staus,QString str);
private slots:
    void getFlashFrameSlot(PARSE_STRUCT parse_s);
};

#endif // FLASHTHREAD_H
